package com.huiyeji.crypt;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;

public class R3Coder implements Coder{

    public static final R3Coder instance = new R3Coder();

    private final Map<Byte,String> rrrMap = new HashMap<>();
    private final Map<Byte,String> sssMap = new HashMap<>();

    public R3Coder(){
        init();
    }

    public String encode(String text){
        return new String(encode(text.getBytes(StandardCharsets.UTF_8)));
    }

    public String decode(String text){
        return new String(decode(text.getBytes(StandardCharsets.UTF_8)));
    }

    @Override
    public byte[] encode(byte[] bytes) {
        byte rc = randomByte();
        byte b2 = randomByte();
        byte b3 = randomByte();

        String sc = rrrMap.get(b2);

        byte[] originBytes = createOriginBytes(sc);
        byte[] mappingBytes = createMappings(originBytes,rc);

        byte[] countMappingBytes = sssMap.get(b3).getBytes();

        Map<Byte,Integer> countMap = new HashMap<>();
        byte[][] encodeArray = new byte[256][2];
        for (int i = 0; i < mappingBytes.length; i++) {
            if (countMap.containsKey(mappingBytes[i])){
                countMap.put(mappingBytes[i],countMap.get(mappingBytes[i])+1);
            } else {
                countMap.put(mappingBytes[i],1);
            }

            encodeArray[i][0] = mappingBytes[i];
            encodeArray[i][1] = countMappingBytes[countMap.get(mappingBytes[i])-1];
        }

        byte[] encode = new byte[bytes.length * 2 + 3];
        encode[0] = rc;
        encode[1] = b2;
        encode[2] = b3;

        for (int i = 0; i < bytes.length; i++) {
            encode[i*2 + 3] = encodeArray[bytes[i] + 128][0];
            encode[i*2 + 4] = encodeArray[bytes[i] + 128][1];
        }

        return encode;
    }

    @Override
    public byte[] decode(byte[] bytes) {
        Map<Byte,Integer> countMap = new HashMap<>();
        Map<Byte,Map<Byte,Byte>> decodeDict = new HashMap<>();

        byte rc = bytes[0];
        byte b2 = bytes[1];
        byte b3 = bytes[2];

        String sc = rrrMap.get(b2);

        byte[] originBytes = createOriginBytes(sc);
        byte[] mappingBytes = createMappings(originBytes,rc);

        byte[] countMappingBytes = sssMap.get(b3).getBytes();

        for (int i = 0; i < mappingBytes.length; i++) {
            if (countMap.containsKey(mappingBytes[i])){
                countMap.put(mappingBytes[i],countMap.get(mappingBytes[i])+1);
            } else {
                countMap.put(mappingBytes[i],1);
            }

            if (decodeDict.containsKey(mappingBytes[i])){
                decodeDict.get(mappingBytes[i]).put(countMappingBytes[countMap.get(mappingBytes[i])-1],(byte) (i-128));
            } else {
                Map<Byte,Byte> map = new HashMap<>();
                map.put(countMappingBytes[0],(byte) (i-128));
                decodeDict.put(mappingBytes[i],map);
            }
        }

        byte[] decodeBytes = new byte[(bytes.length - 3) / 2];
        for (int i = 0; i < decodeBytes.length; i++) {
            byte b = bytes[i * 2 + 3];
            byte c = bytes[i * 2 + 4];
            decodeBytes[i] = decodeDict.get(b).get(c);
        }
        return decodeBytes;
    }

    private static byte[] createOriginBytes(String sc){
        byte[] bytes = new byte[sc.length()];
        for (int i = 0; i < sc.length(); i++) {
            bytes[i] = (byte) sc.charAt(i);
        }
        return bytes;
    }

    private static byte randomByte(){
        Random random = new Random();
        int i = random.nextInt(3);
        if (i == 0){
            return (byte) (random.nextInt(10) + 48);
        } else if (i == 1){
            return (byte) (random.nextInt(26) + 97);
        } else {
            return (byte) (random.nextInt(26) + 65);
        }
    }

    private static byte[] createMappings(byte[] bytes,byte rc){
        byte[] mappingBytes = new byte[256];
        int left = rc + 128 -1;
        int leftP = bytes.length - 1;
        int right = rc;
        int rightP = 0;
        while (left >= 0 || right <= 255) {

            if (leftP < 0) {
                leftP = bytes.length - 1;
            }

            if (rightP == bytes.length) {
                rightP = 0;
            }

            if (left >= 0) {
                mappingBytes[left] = bytes[leftP];
                left--;
                leftP--;
            }

            if (right <= 255) {
                mappingBytes[right] = bytes[rightP];
                right++;
                rightP++;
            }
        }
        return mappingBytes;
    }

    public void encodeFile(String filePath) throws IOException {
        codeFile(filePath,true);
    }

    public void decodeFile(String filePath) throws IOException {
        codeFile(filePath,false);
    }

    private void codeFile(String filePath,boolean isEncode) throws IOException {
        Path path = Paths.get(filePath);
        BufferedInputStream bio = null;
        ByteArrayOutputStream buffer = null;
        BufferedOutputStream bo = null;
        try {
            bio = new BufferedInputStream(Files.newInputStream(path));
            buffer = new ByteArrayOutputStream();
            int nRead;
            byte[] data = new byte[16384];
            while ((nRead = bio.read(data, 0, data.length)) != -1) {
                buffer.write(data, 0, nRead);
            }
            byte[] encodeArray = isEncode ? encode(buffer.toByteArray()) : decode(buffer.toByteArray());
            bo = new BufferedOutputStream(Files.newOutputStream(path));
            bo.write(encodeArray);
            bo.flush();
        } catch (Exception exception){
            exception.printStackTrace();
        } finally {
            if (bio != null){
                bio.close();
            }

            if (buffer != null){
                buffer.close();
            }

            if (bo != null){
                bo.close();
            }
        }
    }


    private void init(){
        rrrMap.put((byte)'0',"df8mSp9whV1ZQ2slyxOC60kjDrKFcaXvAYNH75IB4zWR3ntqTJuPgEGUeMLboi");
        rrrMap.put((byte)'1',"yk1hDW6wSg5mKPe9VRHAMp4dEYcoBvxTn2Qu3JO7bNILqrZ0CasUtijFz8fXGl");
        rrrMap.put((byte)'2',"Ey5aS19NbvMdum3CtpX4HFG7VAxWzolcUTgPKfZJeOn8QD2iqYRjhI60BwrLsk");
        rrrMap.put((byte)'3',"vABITzkhfMJSOj0REnFYeD52oUaQ9W3wqXLblC7gHprG4mKcuPN6idyVs1txZ8");
        rrrMap.put((byte)'4',"pYvqwNQ9LZD2UeonhzSlCJa0ucMX1FIdb3Kg4fmk8VPHTWrOi7GEAtR5x6ysjB");
        rrrMap.put((byte)'5',"yJhC5j4FpaIGxPMn7qUc6QOEwgVRNte9BiTY3bu2f0AzWmrdvsS1LZDHlXk8Ko");
        rrrMap.put((byte)'6',"9A4cXe1J2KDTsa7lMCu8zIEdZwBLSgU5vmqyWQYiGRNOPn0tk6VHj3xofhbFrp");
        rrrMap.put((byte)'7',"e0Fk1dNWxUIqjShDlcORXgQ4wKiHz35tCAmYyb9sVPZraLf26Tu7vopBEGM8Jn");
        rrrMap.put((byte)'8',"58GTQ4yoLtJsKYnNdlVUZcxFvWER0zPmiAB6Mq7DpuC3af2brh9SgjIekXO1Hw");
        rrrMap.put((byte)'9',"dzgiuns4F8L0oxMaOHkZtQjrBVRCIAqwDNXyElY2T6vK1eGUJphmfS5WP79c3b");
        rrrMap.put((byte)'a',"IxERgVWLnUkFeMh5XBD3sNGizZa0CKHtp4dqYPrlS12A9vmJ6cQO8yfj7uTowb");
        rrrMap.put((byte)'b',"XdzyQ5wADB67CPf9UlpjeZH84i3RLFb0oThvGJEmxMskKrONYn1tgSIuWaVq2c");
        rrrMap.put((byte)'c',"lbvZraiGcHmuMLK73TCjVxqF8oXRg1D4QAU620IOwBS5PeE9hpndzkWYyftJNs");
        rrrMap.put((byte)'d',"nf4JPmbKE1vU0S3ZRDFpyqjVgtksIuO6lLWoATBaz72cXNHxdCMQGh9i8erYw5");
        rrrMap.put((byte)'e',"qkhXK24jLzS5EBgNDQrVCMcU7I9uGtesW8RFHZaJ1bOidwAmoPvp0xT3ynYf6l");
        rrrMap.put((byte)'f',"RogSXxbwQpW12Ulm9jHaqczPL8F6t5u3KOE0ZrkdfJGVnivCDY7IAThsNeMBy4");
        rrrMap.put((byte)'g',"Od7zMy1Rjcr8oiA4QtCYeHFXWG2UZInDgK6kNP3spux5qVfb0EawvJlhBSm9TL");
        rrrMap.put((byte)'h',"uWKpnmzMsiQhSjJa37qANHge24dLvDx60okcIZET9ByVXtf85RYlUbO1GwPFrC");
        rrrMap.put((byte)'i',"fHbAY9JiVNUBgC0k7sDhmToSOR84cwQeErtFju2vlWy3LZndIGKz65XP1aMqpx");
        rrrMap.put((byte)'j',"YJ8buFsULmxn1yX4KptZhWjRNP0diIqDoO9EwaAHz3clQeMk7G2fgCVv6BrST5");
        rrrMap.put((byte)'k',"sfTZIFoubWQ59kBjJn1hV64EHtRAwg2YxN7LMqP8ezSGrayDmcivOCXp30KUld");
        rrrMap.put((byte)'l',"JGp0z3rt2VCIaj4ZyXdP8UQnYMWqswugbxhf9o1cFivTm5B7HKDA6OLENSleRk");
        rrrMap.put((byte)'m',"DhfWuygYOwcvekdj8P5tlC1ELIb9V67BQRU2iKpGHnsxJXFaoq0ZATMN43zmrS");
        rrrMap.put((byte)'n',"J0LjRbZlq4MKC8rFsNvuDx5A2ShWcpXe97kYz6wPdHoByaGTgQEtO13iVUfInm");
        rrrMap.put((byte)'o',"CiwbxJjDHShrGysvkZKWcQVa3L0ozEI9mM78Yt1nPUguBlp2ROdAX6eq5TfF4N");
        rrrMap.put((byte)'p',"wDYFsc617LqMaB9u504mXVrCnzQOAIjGZkU28yJtTPpbxioWedEHfgNKR3Slhv");
        rrrMap.put((byte)'q',"tI6pJ0gAZ2o8E3Vy1jr9TqSDnaYhziuWfm5FLcXOU47RdCbBwQlMGNevkxsPKH");
        rrrMap.put((byte)'r',"0Idb2FG1mYAnf7U63EQt9xeRaji5cCHhuqlZ4TLgSwKoDMXVBWyvOrzsNpJP8k");
        rrrMap.put((byte)'s',"vVSKHZYFEjytOhMgCzB8xqAUnbRkIcJNw6DalTdQ2u4sWoXrP7Lm9e5pG013fi");
        rrrMap.put((byte)'t',"H406G29Oz1CugkKQPmWSofcwDFvJB5An3lUIVehptYRyNZiL8dTaMqj7bsrEXx");
        rrrMap.put((byte)'u',"jJmclgTru6MKF8Dq0pHIhGSydz7YC352QL19nikXNZxswbfORPoEAvBVWaet4U");
        rrrMap.put((byte)'v',"HPdjkLAD781nEvVGgh9pJO6a4x2fyZMIcBu0bsNTreYtXUmzKFC3iqQ5wRWSlo");
        rrrMap.put((byte)'w',"VlguYTO9Ad0vGcReNbHkqCMJ4zt2BoZUSXIFi3arEsmQnxyfDW8LP7Kwjph516");
        rrrMap.put((byte)'x',"TnX9fEw0YQGNohd2F3jD4Li5OaH7SxVetcZByrCKRuP8pbzq1lIs6mkJvWAUMg");
        rrrMap.put((byte)'y',"kxUK69bgCrh2vGYeNAEtMHpSoy7Vc3ZLPFJdua0smXQnOjRzq184IDTiw5fWlB");
        rrrMap.put((byte)'z',"FeDWbLkRrK5ANuUajOC09G6od1h27lXV3mPHQItMvTyZfJYqisEBx8ngpcS4zw");
        rrrMap.put((byte)'A',"fvwtmB2ynDKMiqa5duo08TPSV36kUJQesNgxj7XrAZhHYCG9RLOcEWb1I4lFpz");
        rrrMap.put((byte)'B',"lN5aotsKRInzuyDWZfBiv6mgbOjJ4Tc0SPMq87LXwdkAHYeGEhFpU3CV92x1Qr");
        rrrMap.put((byte)'C',"SdvMzPmbIDZuneLH2ir4s16GqEU8V5ChTRpwfoXKFNJ7jBkytaW3gAQl90YcxO");
        rrrMap.put((byte)'D',"FYEy9nX5Jz3DGaHbdPhOkRm8SBtZcCpejW1NQ6qVIM7roLuxTg0ilwAf2U4Kvs");
        rrrMap.put((byte)'E',"1kgR76KxTsdpMBieLH3XhJmrlVN4IvZwOQnGoSAuCaq0PfbtcE8D9YUWyF2j5z");
        rrrMap.put((byte)'F',"EH2vlV0CAXn7cughKUWGDyJNQqSLwx4d8Y5BrZa13FtR9IsePjmiMT6bzkOofp");
        rrrMap.put((byte)'G',"4zpKfvguxcXl0dqoJT2LV8Y7ANeROyFtICWSs1MGrm9jD6BHaiPZnU5kwhQb3E");
        rrrMap.put((byte)'H',"xodCmcQlILNwDJkt3HUhjO6yTfZu9eiKGEvb8VgRzspr0FA1qn27M45SWYBXPa");
        rrrMap.put((byte)'I',"z2QkA7e9NHhtTxC5pluwVcMGUYZPj6IsnFoDKfd1XJWvga08ibrEORymqB43SL");
        rrrMap.put((byte)'J',"SYpf1oJbMju2Kg4LcORseFA0VHByaIzZiG5qtxXDTdlUm7vCQ6rNWw8PnEh39k");
        rrrMap.put((byte)'K',"4PFs2BXcdnZmGKYbjyRHL0VOrEiTzA5eDkhoWCga6qxSulfpM9JNQIw1Ut37v8");
        rrrMap.put((byte)'L',"sPzKp8cbEfhuTHA1ylvdRCM9GatLiZk3qgoYV0D7xIemNXWOFJrwnB2S6jU45Q");
        rrrMap.put((byte)'M',"eXQ2CT5qkWDFLY7OMmbHx1Rifu6U3GnlPoBJ9jpgzw4hyKst0dac8SIArZvVNE");
        rrrMap.put((byte)'N',"yP0zVUpgSjK9vsFH61DBtirQOCmIhN2e4ubRMqoWY7dfLT8wAEZXknJcx5G3al");
        rrrMap.put((byte)'O',"aLcAFxs6I7pl3eB2VZRKnPdfqDSOtgiN0jhGwMv8C5yTJuQX4bUomEzWYrH1k9");
        rrrMap.put((byte)'P',"Wt1hSREvcMJG0oUIbKYaPV6CFyLjOADmn72wld5ur9sX8kBqQfNixze4TgHZ3p");
        rrrMap.put((byte)'Q',"v6RDkr1Kqwj0ncyICGW3ubm5ZsLpTU4VgMSP287XEtaiFAJQYdxhHzleoONf9B");
        rrrMap.put((byte)'R',"2otOArNP3D98LJ6YTuM4lnH0IKqByQX7vECV1UZGWzbwjxmpdRsF5agkehcifS");
        rrrMap.put((byte)'S',"cnyAX2JCRO8vS0UEdqVaLKG1xwY4ij9DoMlktTbgeF6BrPIh5QpWfmHsZNu73z");
        rrrMap.put((byte)'T',"1JEBDyK6YHCl0w9hvRusjNLd4feaUtXp3GTqmZQVWz8rkF527OcAnoISPbMxgi");
        rrrMap.put((byte)'U',"3540PDwTrnAHmXGMQeiNJ98uYakCR6BgxcpIOfvtsoF2lbSUdE7qyKjLW1ZzhV");
        rrrMap.put((byte)'V',"Se1a50ylOtMG4F3cBRbKsLrWDu8jCiVonfpXAU7hPqIwzmxYHvJ2gE9kNQ6ZTd");
        rrrMap.put((byte)'W',"VJfcIK2jQ6pSELBsNhkWCFwYOtyn8xuT97aqeb0MvUGXdZAR5Pz1mo4HDilr3g");
        rrrMap.put((byte)'X',"PjOx9U1mczKkVBGXYgl6J0CqHtTNnyapMWvFQsAZSLR52fwEdIe3D8ruo7bhi4");
        rrrMap.put((byte)'Y',"EUc5T6B3ukMseyWSm14VFtwjxAY9nRJ82dDCqZIoipOfv7G0rHlKPNXLbgazhQ");
        rrrMap.put((byte)'Z',"RmkdeXJTZ2bqfuDgcvEUG0VYH8KMBph5S3ywnQOCt9L6FliN1oWjIxArP74zsa");

        sssMap.put((byte)'0',"cZa9LQx7NUAbHMtlePo1nKJXmdYywEOhRjCF6qp0843IzTfgGDVSvuiBrk2Ws5");
        sssMap.put((byte)'1',"v4aPKLltfyZQMrB5J1NqDH76VUC2RX89GspTz3SeFxcW0EwjognmkYAIhiuOdb");
        sssMap.put((byte)'2',"GlJOS6UITtk9gEXQ7e2hmNp0dDwfzC4aFsxBVLA5iyYbZoKujHr1nvqRP3McW8");
        sssMap.put((byte)'3',"0meqc1blSxiDt6d35OZkLEARQaw4JUTBnFuXhsCf2PjMgzpYrvNoIGVHy9W87K");
        sssMap.put((byte)'4',"NngWYAU6xfGRF3SVzKw9lQi1PaB2sCy7uvEhX58HcOJLboTmj0tIMkerq4dZDp");
        sssMap.put((byte)'5',"bUBH9AC7O0Grgf2vRPc1YMVXiQeKoSlyJpNu6ZnsT53wFk8WdImEztqD4xaLhj");
        sssMap.put((byte)'6',"t2ZwVDQMiPzOLYEAxuqcBk4W3C8RU5nK7yGSm1lrHopbTdXNhJjIfae906gFsv");
        sssMap.put((byte)'7',"AyaSsFoIkuLZ8PC53JpRXdUWgYv4h9MctDe1mVj7nKbHGQBfNiwqlE6xr2TOz0");
        sssMap.put((byte)'8',"sBUVzSrNHf80vJbyEiPlCgFc25q9XD1awjn3eMG6W4poTm7LAdYukKxhQZItOR");
        sssMap.put((byte)'9',"YDvBu4XKMRNJ8Okxo7VCwy1SQFeWlsU9rbnIGipqa05gjT3PZhAmHtLdzEf26c");
        sssMap.put((byte)'a',"kqxyJYzoipmBelKsgFdRTSLPwt7A1X3U9I6ZCWvVb5a2hjf4E0rGOMHDNQ8unc");
        sssMap.put((byte)'b',"Uu3i8l75haYyLozsIWwebDqE9OQC6j4VtBcXGJMTN2RrpAmxgdPv0SfZKnkH1F");
        sssMap.put((byte)'c',"e7mBTsztfVD6XvhUkLK3alEWqS48JIGANc15uxnMwZRFC2Oj9p0YgobirPdyQH");
        sssMap.put((byte)'d',"2iV4cLpwqgzKxTjOu3ZfDmrat7hEBH9IGsdXolFRSQnC8P6JW5eNUYMbvkA10y");
        sssMap.put((byte)'e',"FyXCjAkDVmiOvtbGUHEgLoZQn6a0fJNSsRqdc527uK4TxY1w8zPI39lWBrMhep");
        sssMap.put((byte)'f',"BRhpkLVwrmfvF1Mu0qU6xcGAoHCsJS4OdKgN3aETliP7XZjQ29YDetzIn8Wyb5");
        sssMap.put((byte)'g',"lWDrxtwF5ps12YSAHznR3N4oJQUadCOibLv8E7hkKe6fy9BcmGPXTjIgVZquM0");
        sssMap.put((byte)'h',"M3YXw4niQNAthfdUyCVemO1ojz6qugbvL2HIr0KT8BkDPJR9ZxEa57GWslFpSc");
        sssMap.put((byte)'i',"n1px4ftK7DMieJHvq5jBowzFsZU2u6c8OklmIQLG0b9RTagrhCYEVNXSA3dWPy");
        sssMap.put((byte)'j',"vzDrdLAiZfRmg1VC0WyXYuN8HqlQaJI69hFPUceOj5so4Gw3K2EpSTM7xknbBt");
        sssMap.put((byte)'k',"LVuIXGH2ak9Pp4ewzYKo0vjUiStMBcTDd8JNmAhsfR5Z13QWqCr7byxEOFlgn6");
        sssMap.put((byte)'l',"avYVwBJcWP0kbOx3LlAhoUgjzGQstSRNZ4XdnD6FMm8Iy9fepHu1i57rK2ECTq");
        sssMap.put((byte)'m',"LRV8j7NMemklIAuSPoG1b9XaJcZ3Fw0pKECfDOBvt6yhqYWidHzTg4Usx5nQr2");
        sssMap.put((byte)'n',"6EnrRb4lSoO5BfqheXskGdKzcC9xTiIQUNujypWt3FAD7gwaYV1JLH2mZP0v8M");
        sssMap.put((byte)'o',"9OFNBhrCxjlGZ3aJM0IwWbVokED425iHKpnqUX1gmfYRzPSQyTAuLs786ctved");
        sssMap.put((byte)'p',"NLOJvE4SVaX6mjBDPMlWy1diZrwkef70KnFt8hb35TQUHIcs2CgzGp9RquYxAo");
        sssMap.put((byte)'q',"JL9C2PkQqfnYRStHzVrKFNuc1ZlmyWsvOejbEd6GDgU3TXhaxp5i4A70w8oIMB");
        sssMap.put((byte)'r',"h9gpwZ1KvFRT80G3omysNuek5YUVDtLbI4XfxacHzWOilSC7PrM2QJn6ABEjqd");
        sssMap.put((byte)'s',"o5Q10TRbiWNJFt9wPyzKlMVGjru7g2HfeEcOZBSmaY6n3h8kdIDUXxvAC4pqsL");
        sssMap.put((byte)'t',"PVkqNj0185bvXEZGMHdo2sUTpIwlDyzxnQrcOJWRLu37YBhai4K6Af9gSmeCFt");
        sssMap.put((byte)'u',"fEyPlcUTZjqIBuMFWe64VAHziKXd25r0vo791Ytkm8nwSgahbJxCLNGRp3sQDO");
        sssMap.put((byte)'v',"m7uaPFVYWoUdDbk6JyMLNvOGZctpsQzHCx2n8Ti5AR49SEIX31ehwrql0KjfBg");
        sssMap.put((byte)'w',"IhvLlUsfS61Vpj07DamqZoQi5bckXBWdYgTnEM2RJ98t43uFPyeKwGHzONrACx");
        sssMap.put((byte)'x',"nq0IkiZEfUJvQjNOchS4pa1VX29Rdl75uKgW3wCL8ysxMYAotTeHm6PGrDFzBb");
        sssMap.put((byte)'y',"Z2uMORnAYfErFaTHUPqhSipedWx1XLwcNs0V8j3I9lCQKJgz5GBv6bDkty47mo");
        sssMap.put((byte)'z',"MzBxaOWc52SRdT9VpsJLFgjIi7wQNZUmy3uA4bDGvqnXYhtECPl1K8of06kHer");
        sssMap.put((byte)'A',"aSfDhiBKUqtgsQ8HlM1rvCpYJ3yRk6zcX5oN2ZPxe7j0u4GFWTbdLnmV9AwIEO");
        sssMap.put((byte)'B',"c5Kk7yirwHb9WaJEpUgjQdFvCm2PlZV8GqhxNIozeSBYA0M6O1XtR4sTnDfu3L");
        sssMap.put((byte)'C',"QatkmnGxuHg6P42ocMwqhZErCj7S3YJdzFvLNVWXl5bIfTKADyBORiU01ep9s8");
        sssMap.put((byte)'D',"QG8vfBXwZV6xsyoadjhbN7rEu1p4D2MSCznPIqc5YKWkR3Jlm0gLAiTOHeUF9t");
        sssMap.put((byte)'E',"oN7LCEJ2Mg3SY5xUkdyuVeA8XW0jrsGatDOphHiB1nQZczFqTbR9fKImvlw64P");
        sssMap.put((byte)'F',"aIcDmOk6fgZNjA8zT5noQKVhH0JGrqE43bCUPylBM1Y2LWsew7tiFXRp9Suxdv");
        sssMap.put((byte)'G',"LX1HYKCUahGFjy7bcT4VDzPQigm9n3OIZr8AkJMtfe05WoNERxBlS6qvuw2dps");
        sssMap.put((byte)'H',"T6ndWNzQ3gBkhxUq74mtIsbo8LlujCvJS1DGR09wVEceiArHXKM5p2OPZyFaYf");
        sssMap.put((byte)'I',"xm1fMYz4gVTEeXLFnB6GP5Ro3HpiQCl9WjrDI08OwsA2tvKuka7ZqcbSydNUJh");
        sssMap.put((byte)'J',"xe9KAOQijN1oym2PsvVhzE87GLb03nJRS5ZBHIlC6WrTYcUDfXFqgtpd4Muwak");
        sssMap.put((byte)'K',"MyV4oZ1PqQmfYR5thWLH3Bug2vdTpleOk6F8iCsEx7baAnXDJwKzrcSUI0Nj9G");
        sssMap.put((byte)'L',"YwgXHxGvZ1qRO0rS6cL3eifC2Wu7zytTKmI4kjsBF9JbEUl5Dp8AMQoandNPhV");
        sssMap.put((byte)'M',"YDo6Oaypxn9VrhWkRgetGIuKsJBbHwP78v3j4dfUmTqQ5EcZ0ANLMCX2FS1lzi");
        sssMap.put((byte)'N',"glnwP2qUtMsLfNj0QXyGb3ak8mBxZcJoz7i9vSCFHO5peDRu1AEKTrI4VW6dYh");
        sssMap.put((byte)'O',"62B9djg3vofrRcOGyz1hIPFwipbT4sUEJA5n0tLlVYWqZaumCxNH7Qk8XDeKMS");
        sssMap.put((byte)'P',"BaMj4TxpcQHUGkdbqnKeA5tLh6mlDZsJ9OFV73XgY2RCIzwr80yi1fPoESuNvW");
        sssMap.put((byte)'Q',"naD0Y4I69XJxfrELzyvPQFpV3UZbMKdB8li5RGm1oec7hSsTwOuAjHWtg2kqCN");
        sssMap.put((byte)'R',"YjuwJgb1TxqpX37isDLAUQ6BSGcrka0hn9RmOZo2zFd84IMe5KtEWVlHCNvyfP");
        sssMap.put((byte)'S',"CAQt7iznlBeogd21OUKG6EuPMYWXvkx0jyb4s9FTa5HJINcqRSVprw8mhZLDf3");
        sssMap.put((byte)'T',"ShoTMFa0Zu8XBO4PIs5pe7wQKUCL1mRcijgNztD2VylGd6Wn3HkEYA9qJfvxrb");
        sssMap.put((byte)'U',"ducif0PrKD87O1NG4AZV5XQlMbnIsgS2qJWeBmoYCFhjpR39vEtxk6LUzTyaHw");
        sssMap.put((byte)'V',"jUbf73g2A9r4IihDoxNkuXaSGsPCMV80HyFJZtEBevdK5cWLqRlQ16nYwOmTpz");
        sssMap.put((byte)'W',"5o4drn9GJ03uYXfNqmtE6QpW2aIhecLiVByljCwkKM1HFZvPT8bs7DgOxUAzSR");
        sssMap.put((byte)'X',"Ix1kd7tq6gMp9RVLBv8hzDJTNCbfPGaUOmyurFcHsYo5ZjAQXi2lw0Kn3eW4ES");
        sssMap.put((byte)'Y',"WMoKdqy96pcCBDk1bFzHjtUZ2IgETx47PQ0YiVRvSlJwmG5LearAXfnhsOu38N");
        sssMap.put((byte)'Z',"IaNZH82jchrgqE4BRdDzpVJwK0liXeSOAbvLFMto7PUxy5GnsWk3u1mY6T9fQC");
    }


}
